More various fixes and improvements

Fixes #27