Add row types, improve error handling.