Bug fixes

Fix:
 * #18 
 * #19 
 * #20