Added check of null vector (0,0,0) in php and also for FMI: Fixed some little bugs and the problem of possibility of divided by 0.