Minor improvement to header buttons and sanitizing directory names