Bug hunt

- integer long cast
- possible null dereference