Fixed some interesting malfunctions