Add additional guards copied from @tshinnic.
Add more bitmap guards.
Remove a duplicate call to BCPrepareForOutput.