Bug fixes

Bug Fixes:
 * #18 
 * #19 
 * #20