Added NP check in getBounds(). Closes #1011.