Simplified the static semantics and error reporting

Also added detection of duplicate method parameters