Bugfixes + flash system