Bug fixes

+ Fixed #78
+ Fixed #76
+ Removed unused code