Merge dev into master for version 0.4