Correctly handle tab indentation

Fixes #833