Fixing issue #356.
Fixing #359 provisionally, awaiting reply from Karl Berg.
Fixing issue #359.
Implementing issue #361.
Fixing issue #362.