Bugs fixed and some additions, preparing 1.4.0

Pre 1.4.0