Fixes to get the code working