Fix sloped and curved rail physics bugs, fix item count statements

Signed-off-by: Irmo van den Berge <bergerkiller@gmail.com>