Minor improvements and unnecessary code removed.