Handle edge cases in LR with normal equation + added more tests