Made compile time math and comparison work.
Fixed val local variable support.