Handling the cases when $table is not a string

Added a getTableName() method
Updated the exception messages builder