Fix problems with code