Power Quality Improvement in a Single-Phase Energy Management System Operating in Islanding Mode