Fix for SpoutPlatform compatibility, other fixes/cleanup