Fixed bugs in terraria plugin.