Fixed all remaining bugs