Fix some bugs
Improve test asserts for double

Signed-off-by: Tony G <mipt.shootnick.spam@gmail.com>