Fix cropbox code + minor cleanups.