Fix breakage due to deprecation not being caught by jenkins and a small cleanup