Fixed programming errors

 * String comparisons with ==-operator
 * equals()  with incompatible types

Signed-off-by: Janne Kujanpää <jikuja@iki.fi>
Merge pull request #686 from jikuja/programming_errors

Fixed programming errors