Additional fixes and tests done