Dev 0 4 0

Some changes and fixes from milestone 0.4