Fixed a bunch of bugs
Version bumped up to v0.4.0