Improvements for PR#27, unfixed issues were added as TODOs 

#27