Fixed all the immediate bugs