Fixes #11 (tested with no crash)