Removed some bugs from returning values.