changes to behaviour and added fixes to some stuff
Merge remote-tracking branch 'upstream/master'