fixed bugs

General bug fixing and compensation for data type of input depth map