Made java methods less ambiguous by using correct masks.