Some small changes

some small changes extracted from my current work. i figured the tests at least was worth getting into 13.09