Fix for saving positions to database.