Fix bugs, return {} instead of null when nothing found.