Update to v1.6 with misc bug fixes

Fixes various issues thrown by strict standards etc.