Fixed string comparison to avoid NPE and to use equals()
Fixed redundant val initializer
Fixed redundant initialization