Lots of fixes and a prepend file