Initially fixed #19 and added some other things.