Fixed side check in tile entities failing in rare cases. Closes #590.