Fixed bug with source and sink tables