Tried to fix bug in sample construction