fixed several long vs zend_long casts