Self review and fixing issues found by Bastiaan