Patches master

Just some commits that have been left unnoticed and I found them today.