A few bugfixes, a few new features, a few style corrections

There are several commits here... I think a few of them are important and the rest are a "decent idea" in my opinion...  review and talk to me if you need.