Cleaned up code issues