Handle higher bit depths

Not successfully. There are a number of issues. I think I'm giving up
for now.