Fixed an issue with an incorrect if statement where an empty palceholder attribute was always added, and cleaned up a cpule spelling mistakes in comments.