Bug fixes and patches

Fixed the fact that 0.4.0 was totally broken