Master patch - Fixes merge issues plus a couple more I found while testing it all together.