Hacky bugfixes, but stable version