Fixed long standing bug and other minor tweaks