further cross platform bug fixes