Fixed issues pointed out by Garrett