Fixing more bugs with the code