Updated coding style, fixed tests