Fixed #6. Some cleanup.