Fixed issues based on great feedback of dgrunwald .