Various small fixes for last commit