Basic function fixes