Fixed code issues