Fixes for issues #1, #3, #5 & #6.