"subl" command not working properly
Try creating the subl symlink, it may have been deleted.
In Terminal:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
It should now work.
Edit - one other thing you might check. Do you have two versions of Sublime Text installed, ie versions 2 and 3? From what you say about it not opening up properly with subl but opening fine when you click it in the dock, they may be opening different versions. Look in your applications folder.
Sublime Text 2
ln -sv "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Sublime Text 3
ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl