PEE WAR!!: Minor fix

Fix minor errors and optimize.