Fixes vulnerability reported from issue #4