Updated with some bugfixes, hopefully.