Bunch of fixes

This is getting more and more verbose... I wish we could simplify it.