moving over a few enhancements/bugfixes from Tabula