Some bug fixes, as well as updated features
Some old changes I forgot to commit...
using upstream versions...