Fixed all errors and warnings