Fixed nonconformities with the specification, but value is still wrong.
Fixing warnings in Clang.