Ticket/525

Closes #525