bugfixes and attempt to include appearanceDefs.as as low as possible