Fixed almost all files, so that it now compiles on Flash target