Fixed two issues pointed out by Greg