Fixes #442

This PR addresses the infinite loop bug in `lostTickHandle` and the NPE with crafting pipes.