Added checking and setting of properties. (using bitwise operators)